#pragma once
#ifndef _LIGHTINPUTDRIVER_H
#define _LIGHTINPUTDRIVER_H

#include <queue>

#include "FileStreamExtension.hpp"
#include "Ptr.hpp"
#include "configure.h"
#include "request.h"

#include "LightPosDetector.h"
#include "MouseInput.h"
#include "PlaneProjectTransfer.h"

using namespace std;

class LightInputDriver
{
private:
  Ptr< PointInputDevice > _pDetector;
  Ptr< CoordTransfer > _pCoordTransfer;

  // Space to write x and y value
  float* _pXSpace;
  float* _pYSpace;

  // Queue to send request in
  Ptr< queue< Request > > _pRequestQueue;
  
  bool _read_file ();

public:

  // Initialize, Calibration
  LightInputDriver (float* pXSpace, float* pYSpace,
                    Ptr< queue< Request > > pReqQueue);

  // Start driver (Note it will not return)
  // ************************************
  // Method:  LightInputDriver::run
  // Usage:   Start Light Input Driver
  //          Note that this method will not return
  // Access:  public 
  // Returns: (void) Never returns
  // ************************************
  void run ();

  // For Config Below

  bool config (IN const MyMatrix< float >& cameraPoints,
               IN const MyMatrix< float >& projectPoints);
  bool get_point_in_camera (OUT Array< float >& point);
  bool get_point_in_project (OUT Array< float >& point);
  bool write_file ();
};

#endif